<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--
  Created by IntelliJ IDEA.
  User: shanpengfei
  Date: 2019/2/28
  Time: 5:58 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<style>
    .user-list-content .user-list-item {
        width: 240px;
        height: 470px;
        margin: 20px;
        padding: 10px;
        border-radius: 10px;
        background: rgb(253, 254, 239);
    }
    .user-list-content .user-list-item .item-text {
        line-height: 22px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .user-list-page {
        clear: both;
        padding-bottom: 80px;
    }
    .user-list-page span {
        width: 30px;
        text-align: center;
    }
</style>

<jsp:include page="../template_header.jsp"></jsp:include>
<c:set var="basePath" value="/zyz"></c:set>

<div class="user-list-content">
    <c:forEach items="${joinProjects}" var="list">
        <div class="user-list-item fl">
            <img src="${list.project.pic}" width="240" height="240">

            <div class="item-text" title="${list.project.title}">项目主题：${list.project.title}</div>
            <div class="item-text" title="${list.project.content}">活动内容：${list.project.content}</div>
            <div class="item-text" title="${list.project.time}">项目时间：${list.project.time}</div>
            <c:if test="${sessionScope.user.username=='admin'}">
                <div class="item-text" title="${list.user.id}">志愿者ID：${list.user.id}</div>
                <div class="item-text" title="${list.user.username}">志愿者名：${list.user.username}</div>
            </c:if>
            <div class="item-text" title="${list.content}">宣誓内容：${list.content}</div>
            <div class="item-text" title="<fmt:formatDate value="${list.createAt }" pattern="yyyy-MM-dd"/>">报名时间：<fmt:formatDate value="${list.createAt }" pattern="yyyy-MM-dd"/></div>
            <div class="item-text" title="${list.status==1?'活动未开始':list.status==2?'活动正在进行中':'活动结束'}">活动状态：${list.status==1?'活动未开始':list.status==2?'活动正在进行中':'活动结束'}</div>
            <ul class="item-text">
                <c:if test="${list.status == 1}">
                    <li class="item-text-item fl"><a href="${basePath}/join/del/${list.id}">取消报名</a></li>

                    <li class="item-text-item fl"><a href="${basePath}/join/del/${list.id}/2">开始活动</a></li>
                </c:if>
                <c:if test="${sessionScope.user.username=='admin'}">
                    <c:if test="${list.status == 2}">
                        <li class="item-text-item fl"><a href="${basePath}/join/del/${list.id}/3">活动结束</a></li>
                    </c:if>
                </c:if>
                <li class="clear"></li>
            </ul>
        </div>
    </c:forEach>
    <div class="clear"></div>
</div>


<jsp:include page="../template_footer.jsp"></jsp:include>
